# why here?
minimize topo_aggr: 
  sum {(i1,i2) in LINKS} T[i1,i2];
# This minimize the total number of lower layer edges used in H
# not right yet

s.t. mergeH {(n1,n2) in LINKS, n3 in NODES diff {n1,n2}, (j1,j2) in EDGES}:
  H[n1,n3,j1,j2] + H[n3,n2,j1,j2] - H[n1,n2,j1,j2] <= T2[n1,n2,n3]*100;

s.t. mergeH2 {(n1,n2) in LINKS, n3 in NODES diff {n1,n2}, (j1,j2) in EDGES}:
  -H[n1,n3,j1,j2] -H[n3,n2,j1,j2] + H[n1,n2,j1,j2] <= T2[n1,n2,n3]*100;

s.t. getT {(n1,n2) in LINKS}:
  sum{n3 in NODES diff {n1,n2}} T2[n1,n2,n3] <= T1[n1,n2] + MaxNode -3;  
  #one zero in T2 will drag T1 down to 0.

problem aggrH: topo_aggr, mass_baH, mass_baH2, survH, 
  mergeH, mergeH2, getT, 
  H, T1, T2;
